flipVerticalRange

Flips an image horizontally

  1. auto flipVerticalRange(Image image, IAllocator allocator)
  2. auto flipVerticalRange(IRImage image)
    @nogc @safe
    flipVerticalRange
    (
    IRImage
    ET = ElementType!IRImage
    )
    (
    IRImage image
    )
    if (
    isPixelRange!IRImage
    )

Parameters

image IRImage

The image to flip

Return Value

Type: auto

An input range that returns value for each pixel in the image

Examples

import std.experimental.color;
enum RGB8 TheColor = RGB8(78, 82, 11);

MyTestImage!RGB8 test = new MyTestImage!RGB8(2, 2); 
test.fillOn(TheColor);

final class Foo {
    MyTestImage!RGB8 value;
    alias value this;

    this(MyTestImage!RGB8 value) {
        this.value = value;
    }
}

size_t count;
foreach(pixel; flipVerticalRange(test)) {
    assert(pixel.value == TheColor);
    count++;
}
assert(count == 4);

count = 0;
foreach(pixel; flipVerticalRange(test).flipVerticalRange()) {
    assert(pixel.value == TheColor);
    count++;
}
assert(count == 4);

Meta